package org.iabako.shared.iservice.business;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import org.iabako.shared.entity.business.Client;
import org.iabako.shared.entity.business.CustomFieldValue;
import org.iabako.shared.entity.business.Installment;
import org.iabako.shared.entity.business.Payment;
import org.iabako.shared.entity.user.Enterprise;
import org.iabako.shared.exception.IabakoActionForbiddenException;
import org.iabako.shared.exception.IabakoException;
import org.iabako.shared.iservice.generic.BusinessEntityService;
import org.iabako.shared.iservice.generic.CRUDService;
import org.iabako.shared.iservice.generic.SearchService;
import org.iabako.shared.iservice.generic.SuggestService;

import java.util.List;

/**
 * TODO javadoc
 * Date: 24/11/13
 * Time: 18:22
 */

@RemoteServiceRelativePath("iabakoServices/clientService")
public interface ClientService extends SearchService, SuggestService, CRUDService, BusinessEntityService, RemoteService {

    Client save(Client client) throws IabakoActionForbiddenException;

    List<Payment> getPayments(Client client);

    List<Installment> getInstallments(Client client);

    Client calculateStatus(Client client);

    List<CustomFieldValue> getCustomFieldsValue(Client client);

    Client save(Client client, List<CustomFieldValue> customFieldValues) throws IabakoException;

    Client getClientByEmail(Enterprise enterprise, String email);

    boolean hasInstallments(Client client);
}
